When setting up an account through the wizard for the first time, the
credentials are not saved properly. This requires the user to sign in
again after an application restart.
At least for the login flow v2 case, the `WebFlowCredentials` class
eventually persists the retrieved credentials, whereas the class used
within the wizard (`OCC::Flow2AuthCredsPage`) doesn't.
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
void WebFlowCredentials::persist() {
if (_user.isEmpty()) {
// We don't even have a user nothing to see here move along
+ qCWarning(lcWebFlowCredentials) << "_user is unset, nothing to persist ...";
return;
}
AbstractCredentials *creds = _ocWizard->getCredentials();
if (creds) {
_ocWizard->account()->setCredentials(creds);
+ creds->persist();
}
const auto fetchUserNameJob = new JsonApiJob(_ocWizard->account()->sharedFromThis(), QStringLiteral("/ocs/v1.php/cloud/user"));